/* 
 * Copyright (c) 2009, Giora Kosoi giorak@gmail.com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the project nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Giora Kosoi ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Giora Kosoi BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef VARIANT_INT32_H
#define VARIANT_INT32_H

#include <sparrow/variant.h>
#include <sparrow/types.h>

class VariantInt32 : public Variant
{
    public:
        explicit VariantInt32(int32_t value);
        explicit VariantInt32(const std::string &value);
        explicit VariantInt32(const Octets &value);
        VariantInt32(const uint8_t *value, size_t value_len);
        VariantInt32(const Octets::const_iterator &begin, const Octets::const_iterator &end);
        virtual ~VariantInt32();

        virtual int32_t int32() const;
        virtual void int32(int32_t value);
        virtual uint32_t uint32() const;
        virtual void uint32(uint32_t value);
        virtual int64_t int64() const;
        virtual uint64_t uint64() const;
        virtual const Octets &octets() const;
        virtual void octets(const Octets &value);
        virtual void octets(const uint8_t *value, size_t value_len);
        virtual void octets(const Octets::const_iterator &begin, const Octets::const_iterator &end);
        virtual const std::string &str() const;
        virtual const std::string &pstr() const;
        virtual void str(const std::string &value);

        virtual Variant *clone() const;

    private:
        int32_t value_;
};

#endif // VARIANT_INT32_H

